getTopWin = function(curWin) {

	if (curWin.parent == null) {
		return curWin;
	}
	if (curWin.document.getElementById("header") != null) {
		return curWin;
	}
	var topwin = curWin.parent;
	return getTopWin(topwin);
}


//收缩DIV层
function accordionDiv(ob){
	$(ob).next().slideToggle("slow");
}
//用于连通性时间显示
	//type 1:yyyy-mm-dd hh:MM 2:mm-dd hh:MM 3:dd hh:MM 4:hh:MM
function timeFormart(time,type){
	 if(type==null){
	 	type=2;
	 }
	 
	 var $currentDate = new Date(time);
	 var years = $currentDate.getFullYear();
	 var month = add_zero($currentDate.getMonth()+1);
	 var days = add_zero($currentDate.getDate());
	 var hours = add_zero($currentDate.getHours());
	 var minutes = add_zero($currentDate.getMinutes());
	 var ndate = '';
	 if(type==1){
	 	ndate = years+"-"+month+"-"+days+" "+hours;
	 }else if(type==2){
	 	ndate = month+"-"+days+" "+hours;
	 }else if(type==3){
	 	ndate = days+" "+hours;
	 }else if(type==4){
	 	ndate = hours;
	 }
	 return ndate;
}
function add_zero(temp)
{
	 if(temp<10) 
	 		return "0"+temp;
	 else 
	 		return temp;
}